package open3366pvp.as3.dataStruct
{
	import flash.utils.ByteArray;
	
	import open3366pvp.as3.Open3366PvpEvent;
	
	/**
	 * 获取系列桌子信息
	 * @author mandyxiong
	 * 
	 */	
	public class MassTableProp implements IPvpInfo
	{
		public var gameId:uint;
		public var uid:String;
		public var zoneId:int;
		public var roomId:int;
		public var tableNum:int;
		public var tableList:Array;
		
		public function parasData(data:ByteArray):void
		{
			uid = data.readUTFBytes(32);
			gameId = data.readUnsignedInt();
			zoneId = data.readInt();
			roomId = data.readInt();
			tableNum = data.readInt();
			tableList = [];
			for(var i:int = 0; i < tableNum; i++)
			{
				tableList.push(new TableInfo(data));
			}
		}
		
		public function get eventType():String
		{
			return Open3366PvpEvent.GET_MASS_TABLE_INFO;
		}
		
		public function toString():String
		{
			var str:String = "uid :" + uid + ", gameId" + gameId + ", zoneId" + zoneId + ", roomId " + roomId + "\n";
			for(var i:int = 0; i < tableNum; i++)
			{
				str += ("tableId:" + tableList[i].tableId + ", tableUserTotalCount:" + tableList[i].tableUserTotalCount +  ", bufferSize:" + tableList[i].bufferSize + ", bufferContent:" +tableList[i].bufferData.toString()+";\n");
			}
			return "获取游戏房间批量桌子成功！！\n" + str;
		}
	}
}